package com.nstar.uecenter.view.main.impl
{
	import com.nstar.base.event.AdvanceEvent;
	import com.nstar.base.util.Logger;
	import com.nstar.uecenter.view.components.PopUpTips;
	import com.nstar.uecenter.view.main.AboutUs;
	
	import flash.geom.Point;
	
	import mx.containers.VBox;
	import mx.containers.ViewStack;
	import mx.core.Application;
	import mx.events.FlexEvent;

	public class UECenterMainClass extends VBox
	{
		public var logger:Logger = Logger.getInstance();
		
		public var vsUECenter:ViewStack;
		public var aboutUs:AboutUs;
		
		
		public function UECenterMainClass()
		{
			super();
			this.addEventListener(FlexEvent.CREATION_COMPLETE,init);
		}
		
		private function init(event:FlexEvent):void{
			aboutUs.addEventListener(AboutUsClass.USER_INTERFACE,aboutUsHandler);
			aboutUs.addEventListener(AboutUsClass.INTERACTION_DESIGN,aboutUsHandler);
			aboutUs.addEventListener(AboutUsClass.USER_EXPERIENCE_CENTER,aboutUsHandler);
			aboutUs.addEventListener(AboutUsClass.CONTACT_US,aboutUsHandler);
			aboutUs.addEventListener(AboutUsClass.LABS,aboutUsHandler);
		}
		
		private function aboutUsHandler(event:AdvanceEvent):void{
			switch(event.type){
				case AboutUsClass.USER_EXPERIENCE_CENTER:
					vsUECenter.selectedIndex = 1;
					break;
				case AboutUsClass.LABS:
					vsUECenter.selectedIndex = 2;
					break;
				case AboutUsClass.CONTACT_US:
					vsUECenter.selectedIndex = 3;
					break;
			}
		}
		
	}
}